import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      // 启动要显示的界面
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Evenet使用示例"),
      ),
      body: MyHomeBody(),
    );
  }
}

class MyHomeBody extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Center(
        child: GestureDetector(
          onTapDown: (detail) {
            print('手指按下');
          },
          onTapUp: (detail) {
            print('手指抬起');
          },
          onTapCancel: () {
            print('手势取消');
          },
          onTap: () {
            print('手势点击');
          },
          onDoubleTap: () {
            print('手势双击');
          },
          onLongPress: () {
            print('长按手势');
          },
          child: Container(
            width: 200,
            height: 200,
            color: Colors.green,
          ),
        )
    );
  }
}
